Fix NameError and AttributeError of value_at_risk sampler #329
+2
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contributor Agreements
Please read the contributor agreements and if you agree, please click the checkbox below.
Tip
Please follow the Quick TODO list to smoothly merge your PR.
Motivation
Sorry, my previous PR #320 has bugs that causes the following runtime errors.
NameError: name 'Callable' is not defined. Did you mean: 'callable'?Callableis used incast(Callable[[gp.GPRegressor], torch.Tensor], ...), but is imported only during type checking.AttributeError: module 'optuna._gp' has no attribute 'acqf'optuna._gp.acqfis used incast(optuna._gp.acqf.BaseAcquisitionFunc, acqf)and it seems we need to importoptuna._gp.acqfexplicitly.Description of the changes
TODO List towards PR Merge
Please remove this section if this PR is not an addition of a new package.
Otherwise, please check the following TODO list:
./template/to create your package<COPYRIGHT HOLDER>inLICENSEof your package with your nameREADME.mdin your package__init__.pyfrom __future__ import annotationsat the head of any Python files that include typing to support older Python versionsREADME.mdREADME.md